building a complete websocket app with javascript